<template>
    <page-body>
        <view class="page">
            <view class="flex benben-position-layout flex flex-wrap align-center myCollect_flex_0" :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
                <view class='flex flex-wrap align-center justify-between flex-sub myCollect_fd0_0'>
                    <view class='flex flex-wrap align-center myCollect_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back" data-url="1">
                        <text class='fu-iconfont2  myCollect_fd0_0_c0_c0'>&#xE794;</text>
                    </view>
                    <text class='myCollect_fd0_0_c1'>我的收藏</text>
                    <view class='flex flex-wrap align-center justify-end myCollect_fd0_0_c0'>
                    </view>
                </view>

            </view>
            <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
            <!---flex布局flex布局开始-->
            <view class="flex flex-wrap align-stretch justify-end benben-flex-layout myCollect_flex_1">
                <text class='myCollect_fd1_0' v-if=" type=='1' && list.length > 0" @tap.stop="assignmentFunc()">编辑</text>
				<text class='myCollect_fd1_0' v-if=" type!='1' && list.length > 0" @tap.stop="assignmentFunc()">完成</text>
            </view>

            <!---flex布局flex布局结束-->
            <!---flex布局flex布局开始-->
            <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout myCollect_flex_2" v-if=" type=='1'">
                <template v-for='(item,key0) in list'>
                    <view class='flex flex-wrap align-center myCollect_fd2_0' @tap.stop="handleJumpDiy" data-type="navigateTo" 
					:data-url="`/pages/inSchool/dpDetails/dpDetails?aid=${item.store_id}`">
                        <image class='myCollect_fd2_0_c0' mode="aspectFill" :src='item.logo'></image>
                        <view class='flex flex-direction flex-wrap align-stretch flex-sub'>
                            <text class='myCollect_fd2_0_c1_c0'>{{item.name}}</text>
                            <view class='flex flex-wrap align-center myCollect_fd2_0_c1_c1'>
                                <image class='myCollect_fd2_0_c1_c1_c0' mode="aspectFit" :src='STATIC_URL+"22.png"'></image>
                                <text class='myCollect_fd2_0_c1_c1_c1'>{{item.score}}</text>
                                <text class='myCollect_fd2_0_c1_c1_c2'>月售</text>
                                <text class='myCollect_fd2_0_c1_c1_c3'>{{item.month_sale_num}}</text>
                            </view>
                            <view class='flex flex-wrap align-center myCollect_fd2_0_c1_c2'>
								<template v-for='(child,key1) in item.coupon_list'>
									<view class='flex flex-wrap align-center myCollect_fd2_0_c1_c2_c0'>
										<text class='myCollect_fd2_0_c1_c2_c0_c0'>{{child.name}}</text>
									</view>
								</template>
                            </view>
                        </view>
                    </view>
                </template>
                <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData" :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
            </view>

            <!---flex布局flex布局结束-->
            <!---flex布局flex布局开始-->
            <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout" v-if=" type!='1'">
                <benben-select-diy ref="showSelectPopup1716534333116" class-name='flex flex-direction align-stretch flex' :items.sync="list" v-model="collect_id" :select-all.sync="select" default-type="aid" default-label="name" :allow-cancel='true' type="checkbox" :disabled='false'>
                    <template v-for='(item,key0) in list'>
                        <view v-if="item.isSelected" class='flex align-center flex'   @tap.stop="$refs.showSelectPopup1716534333116.tapHandle(key0)">
                            <image class='myCollect_fd3_0_c0_c0' mode="aspectFit" :src='STATIC_URL+"2.png"'></image>
                            <view class='flex flex-wrap align-center flex-sub myCollect_fd3_0_c0_c1' @tap.stop="handleJumpDiy" data-type="navigateTo" 
					:data-url="`/pages/inSchool/dpDetails/dpDetails?aid=${item.store_id}`">
                                <image class='myCollect_fd3_0_c0_c1_c0' mode="aspectFill" :src='item.logo'></image>
                                <view class='flex flex-direction flex-wrap align-stretch flex-sub'>
                                    <text class='myCollect_fd3_0_c0_c1_c1_c0'>{{item.name}}</text>
                                    <view class='flex flex-wrap align-center myCollect_fd3_0_c0_c1_c1_c1'>
                                        <image class='myCollect_fd3_0_c0_c1_c1_c1_c0' mode="aspectFit" :src='STATIC_URL+"22.png"'></image>
                                        <text class='myCollect_fd3_0_c0_c1_c1_c1_c1'>{{item.score}}</text>
                                        <text class='myCollect_fd3_0_c0_c1_c1_c1_c2'>月售</text>
                                        <text class='myCollect_fd3_0_c0_c1_c1_c1_c3'>{{item.month_sale_num}}</text>
                                    </view>
                                    <view class='flex flex-wrap align-center myCollect_fd3_0_c0_c1_c1_c2'>
										<template v-for='(child,key1) in item.coupon_list'>
											<view class='flex flex-wrap align-center myCollect_fd3_0_c0_c1_c1_c2_c0'>
												<text class='myCollect_fd3_0_c0_c1_c1_c2_c0_c0'>{{child.name}}</text>
											</view>
										</template>
                                    </view>
                                </view>
                            </view>
                        </view>
                        <view v-else class='flex align-center flex' :key="key0" @tap.stop="$refs.showSelectPopup1716534333116.tapHandle(key0)">
                            <image class='myCollect_fd3_0_c0_c0' mode="aspectFit" :src='STATIC_URL+"3.png"'></image>
                            <view class='flex flex-wrap align-center flex-sub myCollect_fd3_0_c0_c1' @tap.stop="handleJumpDiy" data-type="navigateTo" 
					:data-url="`/pages/inSchool/dpDetails/dpDetails?aid=${item.store_id}`">
                                <image class='myCollect_fd3_0_c0_c1_c0' mode="aspectFill" :src='item.logo'></image>
                                <view class='flex flex-direction flex-wrap align-stretch flex-sub'>
                                    <text class='myCollect_fd3_0_c0_c1_c1_c0'>{{item.name}}</text>
                                    <view class='flex flex-wrap align-center myCollect_fd3_0_c0_c1_c1_c1'>
                                        <image class='myCollect_fd3_0_c0_c1_c1_c1_c0' mode="aspectFit" :src='STATIC_URL+"22.png"'></image>
                                        <text class='myCollect_fd3_0_c0_c1_c1_c1_c1'>{{item.score}}</text>
                                        <text class='myCollect_fd3_0_c0_c1_c1_c1_c2'>月售</text>
                                        <text class='myCollect_fd3_0_c0_c1_c1_c1_c3'>{{item.month_sale_num}}</text>
                                    </view>
                                    <view class='flex flex-wrap align-center myCollect_fd3_0_c0_c1_c1_c2'>
                                        <template v-for='(child,key1) in item.coupon_list'>
                                        	<view class='flex flex-wrap align-center myCollect_fd3_0_c0_c1_c1_c2_c0'>
                                        		<text class='myCollect_fd3_0_c0_c1_c1_c2_c0_c0'>{{child.name}}</text>
                                        	</view>
                                        </template>
                                    </view>
                                </view>
                            </view>
                        </view>
                    </template>
                    <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData" :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
                </benben-select-diy>
            </view>

            <!---flex布局flex布局结束-->
            <view class="flex benben-position-layout flex flex-wrap align-center myCollect_flex_4" v-if=" type!='1'">
                <benben-flex-switch-new class-name='flex flex myCollect_fd4_0' v-model="select" :disabled='false' :auto='true' @change="selectAllFunc()">
                    <template v-slot:checked>

                        <view class='flex flex position-relative align-center'>
                            <image class='myCollect_checkfd4_0_c0_c0' mode="aspectFit" :src='STATIC_URL+"2.png"'></image>
                        </view>

                    </template>
                    <template v-slot:unchecked>

                        <view class='flex flex position-relative justify-end align-center'>
                            <image class='myCollect_checkfd4_0_c0_c0' mode="aspectFit" :src='STATIC_URL+"3.png"'></image>
                        </view>

                    </template>
                </benben-flex-switch-new>
                <button class='myCollect_fd4_1' @tap.stop="shanchu">删除</button>

            </view>
            <view :style="{height: '96rpx'}" v-if=" type!='1'"></view>
            <benben-popup v-model="popupShow1716983492299" :mask="true" :mask-close-able="true" mode='center'>
                <!---二次确认框flex布局开始-->
                <view class="flex flex-direction align-center benben-flex-layout myCollect_flex_5">
                    <view class='flex flex-wrap align-center'>
                        <text class='myCollect_fd5_0_c0'>提示</text>
                    </view>
                    <text class='myCollect_fd5_1'>确定删除此收藏吗？</text>
                    <view class='flex align-stretch myCollect_fd5_2'>
                        <view class='flex flex-direction flex-wrap align-center self-center justify-center myCollect_fd5_2_c0' @tap.stop="popupShow1716983492299 = false">
                            <text class='myCollect_fd5_2_c0_c0'>取消</text>
                        </view>
                        <view class='flex flex-direction flex-wrap align-center self-center justify-center myCollect_fd5_2_c1' @tap.stop="getvv46c724cc2a99Func">
                            <text class='myCollect_fd5_2_c1_c0'>确定</text>
                        </view>
                    </view>
                </view>

                <!---二次确认框flex布局结束-->

            </benben-popup>


        </view>
    </page-body>
</template>
<script>
    import pagingList from '@/common/mixin/paging_list.js';
    import {
        validate
    } from '@/common/utils/validate.js'

    export default {
        components: {},
        mixins: [pagingList],

        data() {
            return {
                "popupShow1716983492299": false,
                "minixPagingListsApi": "",
                "pageingListApiMethod": "",
                "allowOnloadGetList": false,
                "type": "1",
                "collectType": [{
                    "name": "1",
                    "value": "1",
                    "image": ""
                }, {
                    "name": "1",
                    "value": "2",
                    "image": ""
                }],
                "collect_id": "",
                "select": false,
                "list": []
            };
        },
        computed: {

        },
        watch: {},
        onLoad(options) {

        },
        onUnload() {

        },
        onReady() {

        },
        onShow() {
            this.getwm36cabd662b22Func()
        },
        onHide() {

        },
        onResize() {

        },
        onPullDownRefresh() {

        },
        onReachBottom(e) {

        },
        onPageScroll(e) {

        },
        methods: {
			shanchu(){
				if(!this.collect_id){
					this.$message.info('请选择需要删除的收藏');
					return
				}
				this.popupShow1716983492299 = true
			},
            //赋值
            assignmentFunc() {
                if (this.type == '1') {
                    this.type = '2';
                } else {
                    this.type = '1';
                }
            },
            //全选
            selectAllFunc() {
                this.$refs.showSelectPopup1716534333116.checkAll();
            },
            //用户管理-收藏列表
            getwm36cabd662b22Func() {
                this.minixPagingListsApi = global.apiUrls.post636cabd662b22;
                this.pageingListApiMethod = 'post';
                this.allowOnloadGetList = false;
                this.pagingListPostDataContent = {
                    type: 'shop'
                }
                this.listData = [];
                this.list = this.listData;
                this.pagingListToggle();

            },
            //删除收藏
            async getvv46c724cc2a99Func() {
                //请求方法
                //数据验证

                let data646c724cc2a99 = await this.$api.post(global.apiUrls.post646c724cc2a99, {
                    aid: this.collect_id
                });

                    this.$message.info(data646c724cc2a99.data.msg);
                if (data646c724cc2a99.data.code != 1) {
                    return
                }
                let info646c724cc2a99 = data646c724cc2a99.data;
				this.popupShow1716983492299 = false
				this.select = false
				this.type = 1


                this.getwm36cabd662b22Func()
            },
            pagingListPostData() {
                return this.pagingListPostDataContent
            }
        }
    };
</script>
<style lang="scss" scoped>
    .page {
        width: 100vw;
        overflow-x: hidden;
        min-height: calc(100vh - var(--window-bottom));
        background: rgba(248, 248, 248, 1);
        background-size: 100% auto;
    }

    .myCollect_flex_0 {
        background: #fff;
        width: 750rpx;
        height: 88rpx;
        overflow: hidden;
        z-index: 10;
        top: 0rpx;
        background-size: 100% auto !important;
    }

    .myCollect_fd0_0_c1 {
        font-size: 36rpx;
        font-weight: 500;
        color: #333333;
        line-height: 50rpx;
    }

    .myCollect_fd0_0_c0_c0 {
        font-size: 36rpx;
        color: #333;
    }

    .myCollect_fd0_0_c0 {
        width: 120rpx;
        height: 88rpx;
    }

    .myCollect_fd0_0 {
        padding: 0rpx 32rpx 0rpx 32rpx;
        height: 88rpx;
    }

    .myCollect_flex_1 {
        padding: 24rpx 32rpx 24rpx 32rpx;
    }

    .myCollect_fd1_0 {
        color: #333333;
        font-size: 28rpx;
        font-weight: 500;
        line-height: 40rpx;
    }

    .myCollect_flex_2 {
        padding: 24rpx 24rpx 0rpx 24rpx;
    }

    .myCollect_fd2_0_c1_c2_c0_c0 {
        color: #FF3707;
        font-size: 20rpx;
        font-weight: 400;
        line-height: 28rpx;
        text-align: left;
        font-style: normal;
    }

    .myCollect_fd2_0_c1_c2_c0 {
        border: 1px solid var(--benbenbdColor2);
        padding: 0rpx 15rpx 0rpx 15rpx;
        border-radius: 8rpx;
        height: 32rpx;
        line-height: 32rpx;
        margin: 0rpx 8rpx 0rpx 0rpx;
    }

    .myCollect_fd2_0_c1_c2 {
        margin: 6rpx 0rpx 0rpx 0rpx;
    }

    .myCollect_fd2_0_c1_c1_c3 {
        color: #999999;
        font-size: 22rpx;
        font-weight: 400;
        line-height: 30rpx;
    }

    .myCollect_fd2_0_c1_c1_c2 {
        color: #999999;
        font-size: 22rpx;
        font-weight: 400;
        line-height: 30rpx;
        margin: 0rpx 0rpx 0rpx 12rpx;
    }

    .myCollect_fd2_0_c1_c1_c1 {
        color: #FF8E21;
        font-size: 20rpx;
        font-weight: 500;
        line-height: 28rpx;
    }

    .myCollect_fd2_0_c1_c1_c0 {
        width: 20rpx;
        height: 20rpx;
        margin: 0rpx 8rpx 0rpx 0rpx;
    }

    .myCollect_fd2_0_c1_c1 {
        margin: 5rpx 0rpx 6rpx 8rpx;
    }

    .myCollect_fd2_0_c1_c0 {
        color: #333333;
        font-size: 32rpx;
        font-weight: 500;
        line-height: 45rpx;
        margin: 0rpx 0rpx 0rpx 8rpx;
        text-align: left;
        font-style: normal;
        -webkit-line-clamp: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
    }

    .myCollect_fd2_0_c0 {
        width: 116rpx;
        height: 116rpx;
        border-radius: 16rpx;
        margin: 0rpx 16rpx 0rpx 0rpx;
    }

    .myCollect_fd2_0 {
        background: var(--benbenbgColor1);
        background-size: 100% auto;
        border-radius: 16rpx;
        padding: 20rpx 0rpx 32rpx 24rpx;
        margin: 0rpx 0rpx 24rpx 0rpx;
    }

    .myCollect_fd3_0_c0_c1_c1_c2_c0_c0 {
        color: #FF3707;
        font-size: 20rpx;
        font-weight: 400;
        line-height: 28rpx;
        text-align: left;
        font-style: normal;
    }

    .myCollect_fd3_0_c0_c1_c1_c2_c0 {
        border: 1px solid var(--benbenbdColor2);
        padding: 0rpx 15rpx 0rpx 15rpx;
        border-radius: 8rpx;
        height: 32rpx;
        line-height: 32rpx;
        margin: 0rpx 8rpx 0rpx 0rpx;
    }

    .myCollect_fd3_0_c0_c1_c1_c2 {
        margin: 6rpx 0rpx 0rpx 0rpx;
    }

    .myCollect_fd3_0_c0_c1_c1_c1_c3 {
        color: #999999;
        font-size: 22rpx;
        font-weight: 400;
        line-height: 30rpx;
    }

    .myCollect_fd3_0_c0_c1_c1_c1_c2 {
        color: #999999;
        font-size: 22rpx;
        font-weight: 400;
        line-height: 30rpx;
        margin: 0rpx 0rpx 0rpx 12rpx;
    }

    .myCollect_fd3_0_c0_c1_c1_c1_c1 {
        color: #FF8E21;
        font-size: 20rpx;
        font-weight: 500;
        line-height: 28rpx;
    }

    .myCollect_fd3_0_c0_c1_c1_c1_c0 {
        width: 20rpx;
        height: 20rpx;
        margin: 0rpx 8rpx 0rpx 0rpx;
    }

    .myCollect_fd3_0_c0_c1_c1_c1 {
        margin: 5rpx 0rpx 6rpx 8rpx;
    }

    .myCollect_fd3_0_c0_c1_c1_c0 {
        color: #333333;
        font-size: 32rpx;
        font-weight: 500;
        line-height: 45rpx;
        margin: 0rpx 0rpx 0rpx 8rpx;
        text-align: left;
        font-style: normal;
        -webkit-line-clamp: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
    }

    .myCollect_fd3_0_c0_c1_c0 {
        width: 116rpx;
        height: 116rpx;
        border-radius: 16rpx;
        margin: 0rpx 16rpx 0rpx 0rpx;
    }

    .myCollect_fd3_0_c0_c1 {
        background: var(--benbenbgColor1);
        background-size: 100% auto;
        border-radius: 16rpx;
        padding: 20rpx 0rpx 32rpx 24rpx;
        margin: 0rpx 0rpx 24rpx 0rpx;
    }

    .myCollect_fd3_0_c0_c0 {
        width: 36rpx;
        height: 36rpx;
        margin: 0rpx 16rpx 0rpx 12rpx;
    }

    .myCollect_flex_4 {
        background: var(--benbenbgColor1);
        width: 750rpx;
        height: 96rpx;
        overflow: hidden;
        z-index: 10;
        bottom: calc(0rpx + var(--window-bottom));
        background-size: 100% auto;
    }

    .myCollect_fd4_1 {
        background: #F6F6F6;
        border-radius: 44rpx 44rpx 44rpx 44rpx;
        width: 200rpx;
        line-height: 72rpx;
        font-size: 28rpx;
        color: var(--benbenFontColor0);
        height: 72rpx;
        margin: 0rpx 24rpx 0rpx auto;
    }

    .myCollect_checkfd4_0_c0_c0 {
        width: 36rpx;
        height: 36rpx;
    }

    ::v-deep .myCollect_fd4_0 {
        margin: 0rpx 16rpx 0rpx 32rpx;
    }

    .myCollect_flex_5 {
        background: rgba(255, 255, 255, 1);
        border-radius: 16rpx 16rpx 16rpx 16rpx;
        padding: 40rpx 0rpx 0rpx 0rpx;
        width: 540rpx;
    }

    .myCollect_fd5_2_c1_c0 {
        color: #ED702D;
        font-size: 32rpx;
        font-weight: 500;
    }

    .myCollect_fd5_2_c1 {
        width: 50%;
        height: 110rpx;
    }

    .myCollect_fd5_2_c0_c0 {
        color: #999999;
        font-size: 32rpx;
        font-weight: 500;
        text-align: center;
    }

    .myCollect_fd5_2_c0 {
        border-right: 1px solid #eee;
        width: 50%;
        height: 110rpx;
        text-align: center;
    }

    .myCollect_fd5_2 {
        border-top: 1px solid #eee;
        width: 100%;
    }

    .myCollect_fd5_1 {
        line-height: 44rpx;
        font-size: 28rpx;
        font-weight: 400;
        color: var(--benbenFontColor0);
        margin: 40rpx 0rpx 50rpx 0rpx;
    }

    .myCollect_fd5_0_c0 {
        color: #333333;
        font-size: 36rpx;
        font-weight: 500;
    }
</style>